
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    </head>
    <body>
        <h3>RequestPerEventBuffered Stress Test</h3>
        <div id ="main">
             <div id="e1"></div>
             <div id="e2"></div>
             <div id="e3"></div>
             <div id="e4"></div>
             <div id="e5"></div>
             <div id="e6"></div>
             <div id="e7"></div>
             <div id="e8"></div>
             <div id="e9"></div>
             <div id="e10"></div>
             <div id="e11"></div>
             <div id="e12"></div>
             <div id="e13"></div>
             <div id="e14"></div>
             <div id="e15"></div>
             <div id="e16"></div>
             <div id="e17"></div>
             <div id="e18"></div>
             <div id="e19"></div>
             <div id="e20"></div>
        </div>


        <script>
            var SIZE = 20;
            var EVENT_SOURCE_URL = 'RequestPerEventBuffered'; // event source url
            var setupEventSource = function(index) {
                var src = new EventSource(EVENT_SOURCE_URL);
                src.onmessage=function(event) {
                $("#e"+index).html("event listener no " +index + " last update:" +new Date());
                console.log('event received - ' + index);
            }
            };
            
            for (var i=0;i<=SIZE;i++) {
                setupEventSource(i+1);
            }

        </script>

    </body>
</html>
